# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=pppusage
pkgver=0.2.5
pkgrel=14
pkgdesc="Utility to monitor pppd connections"
arch=(any)
url="https://www.jhweiss.de/software/pppusage.html"
license=("GPL")
depends=(perl ppp cron)
makedepends=()
backup=(etc/pppusagerc)
#source=(ftp://ftp.jhweiss.de/pub/users/weiss/pppusage/pppusage-$pkgver.tar.gz
source=(https://arch.p5n.pp.ru/~sergej/dl/2012/pppusage-$pkgver.tar.gz
        build-fix.patch)
sha256sums=('24d0390671ba000ddae2cc56b62064fcc55d5868693c46b116244de6c01233b8'
            '71918a98d4ff834437eed110ea81215ddf04d18bdce2939c2170148ba29f086e')

build() {
  cd "$srcdir"/pppusage-$pkgver
  patch -Np1 <../build-fix.patch
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

package() {
  cd "$srcdir"/pppusage-$pkgver
  make DESTDIR="$pkgdir" install
  rm "$pkgdir"/usr/lib/perl5/*/core_perl/perllocal.pod
  find "$pkgdir" -name '.packlist' -exec rm {} \;
}
